const state = {
    /**查询 */
    //性别
    input_sex: "",
    //班级
    input_class: "",
    //年级
    input_grade: "",
    //学校
    autocomplete_school: "",
    //科目
    input_subject: "",
    //成绩条件
    input_testSelect: 1,
    //成绩
    input_testValue: '',
    //成绩数组
    input_testValueArray: {
        //成绩条件
        testSelect: 1,
        //成绩
        testValue: [],
    },

    /**表格 */
    //表格标签
    table_tableLable: [],
    //表格值
    table_tableData: [],
    //表格操作显示
    table_show: false,
    //表格行
    table_row: {},
    /**分页 */
    //分页总数量
    pagination_total: 0,
    //分页总大小
    pagination_pageSize: 10,
    //分页数量
    pagination_pageNum: 1,
};

const getters = {
    getTable_row(state) {
        return state.table_row;
    }
};

const mutations = {
    //成绩
    setTestSelect(state, value) {
        state.input_testValueArray.testSelect = value;
        state.input_testSelect = value;
    },
    setTestValue(state, value) {
        state.input_testValueArray.testValue = value;
        state.input_testValue = value;
    },
    setTestValueLength(state) {
        state.input_testValueArray.testValue.length = 0;
    },
    //设置学校的值
    setAutocomplete_school(state, value) {
        state.autocomplete_school = value;
    },
    //设置班级的值
    setInput_class(state, value) {
        state.input_class = value;
    },
    //设置年级的值
    setInput_grade(state, value) {
        state.input_grade = value;
    },
    //设置性别的值
    setInput_sex(state, value) {
        state.input_sex = value;
    },
    //设置性别的值
    setInput_subject(state, value) {
        state.input_subject = value;
    },
    //表格标签
    setTable_tableLable(state, value) {
        state.table_tableLable = value;
    },
    //表格值
    setTable_tableData(state, value) {
        state.table_tableData = value;
    },
    //表格操作显示
    setTable_show(state, value) {
        state.table_show = value;
    },
    //表格行
    setTable_row(state, value) {
        state.table_row = value;
    },
    //分页总数量
    setPagination_total(state, value) {
        state.pagination_total = value;
    },
    //分页总大小
    setPagination_pageSize(state, value) {
        state.pagination_pageSize = value;
    },
    //分页数量
    setPagination_pageNum(state, value) {
        state.pagination_pageNum = value;
    },
    //重置
    setReset(state) {
        state.input_sex = '';
        state.input_class = '';
        state.input_grade = '';
        state.autocomplete_school = '';
        state.input_subject = '';
        state.input_testSelect = '';
        state.input_testValue = '';
        state.input_testValueArray = {
                testSelect: 1,
                testValue: []
            },
            state.pagination_pageSize = 10;
        state.pagination_pageNum = 1;
    }

}

export default {
    namespaced: true,
    state,
    getters,
    mutations
}